<?php
/**
 * (commands) 采购合同文件（PDF）
 */
namespace App\Console\Commands\Purchase;

use Illuminate\Console\Command;
use App\Logic\Purchase\CreatePOContract as LCreatePOContract;
class CreatePOContract extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'po:contract {param*}';

    /**
     * The console command description.
     * @var string
     */
    protected $description = 'create po-contract';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $param = $this->argument('param');
        if(!isset($param['id'])&&!$param['id']){
            $this->error('请提供参数!');
        }else{
            LCreatePOContract::handle($param);
            $this->info('同步完成！');
        }
    }
}
